package net.chenlin.dp.base.manager.impl;

import net.chenlin.dp.base.dao.DictTableMapper;
import net.chenlin.dp.base.entity.DictTableEntity;
import net.chenlin.dp.base.manager.DictTableManager;
import net.chenlin.dp.common.entity.Page;
import net.chenlin.dp.common.entity.Query;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by lance on 2018/2/2.
 */
@Component("dictTableManger")
public class DictTableMangerImpl implements DictTableManager {
    @Autowired
    private DictTableMapper dictTableMapper;
    @Override
    public List<DictTableEntity> listDpTableColum(Page<DictTableEntity> page, Query search) {
        return dictTableMapper.listForPage(page,search);
    }

    @Override
    public int saveDpTableColum(DictTableEntity dpTableColum) {
        return dictTableMapper.save(dpTableColum);
    }

    @Override
    public DictTableEntity getDpTableColumById(Long id) {
        return dictTableMapper.getObjectById(id);
    }

    @Override
    public int updateDpTableColum(DictTableEntity dpTableColum) {
        return dictTableMapper.update(dpTableColum);
    }

    @Override
    public int batchRemove(Long[] id) {
        return dictTableMapper.batchRemove(id);
    }

    @Override
    public List<DictTableEntity> listByIds(Long [] ids) {
       return dictTableMapper.listByIds( ids);
    }
}
